﻿<UserControl
    x:Class="NotepadSilverlight.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400"
    xmlns:local="clr-namespace:NotepadSilverlight"
    xmlns:l="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
    xmlns:System="clr-namespace:System;assembly=mscorlib"
    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    xmlns:System_Windows_Controls_Primitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls"
    xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
    xmlns:dataPrimitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Data"
    FontFamily="Calibri">
    <UserControl.Resources>
        
        <local:BoolToFlowDirectionConverter
            x:Key="BoolToFlowDirectionConverter" />
        
        <local:Strings
            x:Key="localizedStrings" />
        
        <Style
            x:Key="MenuLabel"
            TargetType="TextBlock">
            <Setter
                Property="FontSize"
                Value="18" />
            <Setter
                Property="Foreground"
                Value="#FF1D50A3" />
            <Setter
                Property="HorizontalAlignment"
                Value="Center" />
            <Setter
                Property="VerticalAlignment"
                Value="Bottom" />
            <Setter
                Property="Margin"
                Value="0,0,0,1" />
        </Style>
        <Style
            x:Key="RichTextBoxStyle1"
            TargetType="RichTextBox">
            <Setter
                Property="BorderThickness"
                Value="1" />
            <Setter
                Property="Background"
                Value="#FFFFFFFF" />
            <Setter
                Property="Foreground"
                Value="#FF000000" />
            <Setter
                Property="Padding"
                Value="2" />
            <Setter
                Property="BorderBrush">
                <Setter.Value>
                    <LinearGradientBrush
                        EndPoint="0.5,1"
                        StartPoint="0.5,0">
                        <GradientStop
                            Color="#FFA3AEB9"
                            Offset="0" />
                        <GradientStop
                            Color="#FF8399A9"
                            Offset="0.375" />
                        <GradientStop
                            Color="#FF718597"
                            Offset="0.375" />
                        <GradientStop
                            Color="#FF617584"
                            Offset="1" />
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter
                Property="Template">
                <Setter.Value>
                    <ControlTemplate
                        TargetType="RichTextBox">
                        <Grid
                            x:Name="RootElement">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup
                                    x:Name="CommonStates">
                                    <VisualState
                                        x:Name="Normal" />
                                    <VisualState
                                        x:Name="MouseOver" />
                                    <VisualState
                                        x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames
                                                Storyboard.TargetProperty="Opacity"
                                                Storyboard.TargetName="DisabledVisualElement">
                                                <SplineDoubleKeyFrame
                                                    KeyTime="0"
                                                    Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState
                                        x:Name="ReadOnly">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames
                                                Storyboard.TargetProperty="Opacity"
                                                Storyboard.TargetName="ReadOnlyVisualElement">
                                                <SplineDoubleKeyFrame
                                                    KeyTime="0"
                                                    Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup
                                    x:Name="FocusStates">
                                    <VisualState
                                        x:Name="Focused" />
                                    <VisualState
                                        x:Name="Unfocused" />
                                </VisualStateGroup>
                                <VisualStateGroup
                                    x:Name="ValidationStates">
                                    <VisualState
                                        x:Name="Valid" />
                                    <VisualState
                                        x:Name="InvalidUnfocused">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames
                                                Storyboard.TargetProperty="Visibility"
                                                Storyboard.TargetName="ValidationErrorElement">
                                                <DiscreteObjectKeyFrame
                                                    KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState
                                        x:Name="InvalidFocused">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames
                                                Storyboard.TargetProperty="Visibility"
                                                Storyboard.TargetName="ValidationErrorElement">
                                                <DiscreteObjectKeyFrame
                                                    KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames
                                                Storyboard.TargetProperty="IsOpen"
                                                Storyboard.TargetName="validationTooltip">
                                                <DiscreteObjectKeyFrame
                                                    KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <System:Boolean>True</System:Boolean>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border
                                x:Name="Border"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="1"
                                Opacity="1">
                                <Grid>
                                    <Border
                                        x:Name="ReadOnlyVisualElement"
                                        Background="#72F7F7F7"
                                        Opacity="0" />
                                    <Border
                                        x:Name="MouseOverBorder"
                                        BorderBrush="Transparent"
                                        BorderThickness="1">
                                        <ScrollViewer
                                            x:Name="ContentElement"
                                            BorderThickness="0"
                                            IsTabStop="False"
                                            Padding="{TemplateBinding Padding}" />
                                    </Border>
                                </Grid>
                            </Border>
                            <Border
                                x:Name="DisabledVisualElement"
                                BorderBrush="#A5F7F7F7"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="#A5F7F7F7"
                                IsHitTestVisible="False"
                                Opacity="0" />
                            <Border
                                x:Name="FocusVisualElement"
                                BorderBrush="#FFB8B8B8"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                IsHitTestVisible="False"
                                Margin="1"
                                Opacity="0" />
                            <Border
                                x:Name="ValidationErrorElement"
                                BorderBrush="#FFDB000C"
                                BorderThickness="1"
                                CornerRadius="1"
                                Visibility="Collapsed">
                                <ToolTipService.ToolTip>
                                    <ToolTip
                                        x:Name="validationTooltip"
                                        DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                        Placement="Right"
                                        PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                        Template="{StaticResource ValidationToolTipTemplate}">
                                        <ToolTip.Triggers>
                                            <EventTrigger
                                                RoutedEvent="Canvas.Loaded">
                                                <BeginStoryboard>
                                                    <Storyboard>
                                                        <ObjectAnimationUsingKeyFrames
                                                            Storyboard.TargetProperty="IsHitTestVisible"
                                                            Storyboard.TargetName="validationTooltip">
                                                            <DiscreteObjectKeyFrame
                                                                KeyTime="0">
                                                                <DiscreteObjectKeyFrame.Value>
                                                                    <System:Boolean>true</System:Boolean>
                                                                </DiscreteObjectKeyFrame.Value>
                                                            </DiscreteObjectKeyFrame>
                                                        </ObjectAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </BeginStoryboard>
                                            </EventTrigger>
                                        </ToolTip.Triggers>
                                    </ToolTip>
                                </ToolTipService.ToolTip>
                                <Grid
                                    Background="Transparent"
                                    HorizontalAlignment="Right"
                                    Height="12"
                                    Margin="1,-4,-4,0"
                                    VerticalAlignment="Top"
                                    Width="12">
                                    <Path
                                        Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z"
                                        Fill="#FFDC000C"
                                        Margin="1,3,0,0" />
                                    <Path
                                        Data="M 0,0 L2,0 L 8,6 L8,8"
                                        Fill="#ffffff"
                                        Margin="1,3,0,0" />
                                </Grid>
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <LinearGradientBrush
            x:Key="MenuDividerBrush"
            EndPoint="0.5,1"
            StartPoint="0.5,0">
            <GradientStop
                Color="#FFC0D8F0"
                Offset="1" />
            <GradientStop
                Color="#FFDBE6F3"
                Offset="0" />
            <GradientStop
                Color="#FFC1D9F1"
                Offset="0.685" />
            <GradientStop
                Color="#FFD7E7F5"
                Offset="0.678" />
            <GradientStop
                Color="#FFDAE6F3"
                Offset="0.133" />
            <GradientStop
                Color="#FFC7D8ED"
                Offset="0.174" />
            <GradientStop
                Color="#FFC8D9ED"
                Offset="0.478" />
        </LinearGradientBrush>
        <Style
            x:Key="DataGridStyle1"
            TargetType="data:DataGrid">
            <Setter
                Property="RowBackground"
                Value="#AAEAEFF4" />
            <Setter
                Property="AlternatingRowBackground"
                Value="#00FFFFFF" />
            <Setter
                Property="Background"
                Value="#FFFFFFFF" />
            <Setter
                Property="HeadersVisibility"
                Value="Column" />
            <Setter
                Property="HorizontalScrollBarVisibility"
                Value="Auto" />
            <Setter
                Property="VerticalScrollBarVisibility"
                Value="Auto" />
            <Setter
                Property="SelectionMode"
                Value="Extended" />
            <Setter
                Property="CanUserReorderColumns"
                Value="True" />
            <Setter
                Property="CanUserResizeColumns"
                Value="True" />
            <Setter
                Property="CanUserSortColumns"
                Value="True" />
            <Setter
                Property="AutoGenerateColumns"
                Value="True" />
            <Setter
                Property="RowDetailsVisibilityMode"
                Value="VisibleWhenSelected" />
            <Setter
                Property="BorderBrush">
                <Setter.Value>
                    <LinearGradientBrush
                        EndPoint="0.5,1"
                        StartPoint="0.5,0">
                        <GradientStop
                            Color="#FFA3AEB9"
                            Offset="0" />
                        <GradientStop
                            Color="#FF8399A9"
                            Offset="0.375" />
                        <GradientStop
                            Color="#FF718597"
                            Offset="0.375" />
                        <GradientStop
                            Color="#FF617584"
                            Offset="1" />
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter
                Property="BorderThickness"
                Value="1" />
            <Setter
                Property="DragIndicatorStyle">
                <Setter.Value>
                    <Style
                        TargetType="ContentControl">
                        <Setter
                            Property="Foreground"
                            Value="#7FFFFFFF" />
                        <Setter
                            Property="Template">
                            <Setter.Value>
                                <ControlTemplate
                                    TargetType="ContentControl">
                                    <Grid>
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup
                                                x:Name="SortStates">
                                                <VisualState
                                                    x:Name="Unsorted" />
                                                <VisualState
                                                    x:Name="SortAscending">
                                                    <Storyboard>
                                                        <DoubleAnimation
                                                            Duration="0"
                                                            To="1.0"
                                                            Storyboard.TargetProperty="Opacity"
                                                            Storyboard.TargetName="SortIcon" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState
                                                    x:Name="SortDescending">
                                                    <Storyboard>
                                                        <DoubleAnimation
                                                            Duration="0"
                                                            To="1.0"
                                                            Storyboard.TargetProperty="Opacity"
                                                            Storyboard.TargetName="SortIcon" />
                                                        <DoubleAnimation
                                                            Duration="0"
                                                            To="-.9"
                                                            Storyboard.TargetProperty="(RenderTransform).ScaleY"
                                                            Storyboard.TargetName="SortIcon" />
                                                    </Storyboard>
                                                </VisualState>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <Rectangle
                                            x:Name="BackgroundRectangle"
                                            Grid.ColumnSpan="2"
                                            Fill="#66808080"
                                            Stretch="Fill" />
                                        <Rectangle
                                            x:Name="BackgroundGradient"
                                            Grid.ColumnSpan="2"
                                            Opacity="0"
                                            Stretch="Fill">
                                            <Rectangle.Fill>
                                                <LinearGradientBrush
                                                    EndPoint=".7,1"
                                                    StartPoint=".7,0">
                                                    <GradientStop
                                                        Color="#FFFFFFFF"
                                                        Offset="0.015" />
                                                    <GradientStop
                                                        Color="#F9FFFFFF"
                                                        Offset="0.375" />
                                                    <GradientStop
                                                        Color="#E5FFFFFF"
                                                        Offset="0.6" />
                                                    <GradientStop
                                                        Color="#C6FFFFFF"
                                                        Offset="1" />
                                                </LinearGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <Grid
                                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                            Margin="{TemplateBinding Padding}"
                                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition />
                                                <ColumnDefinition
                                                    Width="Auto" />
                                            </Grid.ColumnDefinitions>
                                            <ContentPresenter
                                                Content="{TemplateBinding Content}" />
                                            <Path
                                                x:Name="SortIcon"
                                                Grid.Column="1"
                                                Data="F1 M -5.215,6.099L 5.215,6.099L 0,0L -5.215,6.099 Z "
                                                Fill="#7FFFFFFF"
                                                HorizontalAlignment="Left"
                                                Margin="4,0,0,0"
                                                Opacity="0"
                                                RenderTransformOrigin=".5,.5"
                                                Stretch="Uniform"
                                                VerticalAlignment="Center"
                                                Width="8">
                                                <Path.RenderTransform>
                                                    <ScaleTransform
                                                        ScaleY=".9"
                                                        ScaleX=".9" />
                                                </Path.RenderTransform>
                                            </Path>
                                        </Grid>
                                    </Grid>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </Setter.Value>
            </Setter>
            <Setter
                Property="DropLocationIndicatorStyle">
                <Setter.Value>
                    <Style
                        TargetType="ContentControl">
                        <Setter
                            Property="Background"
                            Value="#FF3F4346" />
                        <Setter
                            Property="Width"
                            Value="2" />
                        <Setter
                            Property="Template">
                            <Setter.Value>
                                <ControlTemplate
                                    TargetType="ContentControl">
                                    <Rectangle
                                        Fill="{TemplateBinding Background}"
                                        Height="{TemplateBinding Height}"
                                        Width="{TemplateBinding Width}" />
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </Setter.Value>
            </Setter>
            <Setter
                Property="GridLinesVisibility"
                Value="Vertical" />
            <Setter
                Property="HorizontalGridLinesBrush"
                Value="#FFC9CACA" />
            <Setter
                Property="IsTabStop"
                Value="True" />
            <Setter
                Property="VerticalGridLinesBrush"
                Value="#FFC9CACA" />
            <Setter
                Property="Template">
                <Setter.Value>
                    <ControlTemplate
                        TargetType="data:DataGrid">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup
                                    x:Name="CommonStates">
                                    <VisualState
                                        x:Name="Normal" />
                                    <VisualState
                                        x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation
                                                Duration="0"
                                                To="0.5"
                                                Storyboard.TargetProperty="Opacity"
                                                Storyboard.TargetName="DisabledVisualElement"
                                                From="0" />
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="2">
                                <Grid
                                    x:Name="Root"
                                    Background="{TemplateBinding Background}">
                                    <Grid.Resources>
                                        <ControlTemplate
                                            x:Key="TopLeftHeaderTemplate"
                                            TargetType="dataPrimitives:DataGridColumnHeader">
                                            <Grid
                                                x:Name="Root">
                                                <Grid.RowDefinitions>
                                                    <RowDefinition />
                                                    <RowDefinition />
                                                    <RowDefinition
                                                        Height="Auto" />
                                                </Grid.RowDefinitions>
                                                <Border
                                                    BorderBrush="#FFC9CACA"
                                                    BorderThickness="0,0,1,0"
                                                    Background="#FF1F3B53"
                                                    Grid.RowSpan="2">
                                                    <Rectangle
                                                        Stretch="Fill"
                                                        StrokeThickness="1">
                                                        <Rectangle.Fill>
                                                            <LinearGradientBrush
                                                                EndPoint=".7,1"
                                                                StartPoint=".7,0">
                                                                <GradientStop
                                                                    Color="#FCFFFFFF"
                                                                    Offset="0.015" />
                                                                <GradientStop
                                                                    Color="#F7FFFFFF"
                                                                    Offset="0.375" />
                                                                <GradientStop
                                                                    Color="#E5FFFFFF"
                                                                    Offset="0.6" />
                                                                <GradientStop
                                                                    Color="#D1FFFFFF"
                                                                    Offset="1" />
                                                            </LinearGradientBrush>
                                                        </Rectangle.Fill>
                                                    </Rectangle>
                                                </Border>
                                                <Rectangle
                                                    Fill="#FFDBDCDC"
                                                    Height="1"
                                                    Grid.RowSpan="2"
                                                    StrokeThickness="1"
                                                    VerticalAlignment="Bottom"
                                                    Width="Auto" />
                                            </Grid>
                                        </ControlTemplate>
                                        <ControlTemplate
                                            x:Key="TopRightHeaderTemplate"
                                            TargetType="dataPrimitives:DataGridColumnHeader">
                                            <Grid
                                                x:Name="RootElement">
                                                <Grid.RowDefinitions>
                                                    <RowDefinition />
                                                    <RowDefinition />
                                                    <RowDefinition
                                                        Height="Auto" />
                                                </Grid.RowDefinitions>
                                                <Border
                                                    BorderBrush="#FFC9CACA"
                                                    BorderThickness="1,0,0,0"
                                                    Background="#FF1F3B53"
                                                    Grid.RowSpan="2">
                                                    <Rectangle
                                                        Stretch="Fill">
                                                        <Rectangle.Fill>
                                                            <LinearGradientBrush
                                                                EndPoint=".7,1"
                                                                StartPoint=".7,0">
                                                                <GradientStop
                                                                    Color="#FCFFFFFF"
                                                                    Offset="0.015" />
                                                                <GradientStop
                                                                    Color="#F7FFFFFF"
                                                                    Offset="0.375" />
                                                                <GradientStop
                                                                    Color="#E5FFFFFF"
                                                                    Offset="0.6" />
                                                                <GradientStop
                                                                    Color="#D1FFFFFF"
                                                                    Offset="1" />
                                                            </LinearGradientBrush>
                                                        </Rectangle.Fill>
                                                    </Rectangle>
                                                </Border>
                                            </Grid>
                                        </ControlTemplate>
                                    </Grid.Resources>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition
                                            Width="Auto" />
                                        <ColumnDefinition />
                                        <ColumnDefinition
                                            Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition
                                            Height="Auto" />
                                        <RowDefinition />
                                        <RowDefinition
                                            Height="Auto" />
                                        <RowDefinition
                                            Height="Auto" />
                                    </Grid.RowDefinitions>
                                    <dataPrimitives:DataGridColumnHeader
                                        x:Name="TopLeftCornerHeader"
                                        Template="{StaticResource TopLeftHeaderTemplate}"
                                        Width="22" />
                                    <dataPrimitives:DataGridColumnHeadersPresenter
                                        x:Name="ColumnHeadersPresenter"
                                        Grid.Column="1" />
                                    <dataPrimitives:DataGridColumnHeader
                                        x:Name="TopRightCornerHeader"
                                        Grid.Column="2"
                                        Template="{StaticResource TopRightHeaderTemplate}" />
                                    <Rectangle
                                        x:Name="ColumnHeadersAndRowsSeparator"
                                        Grid.ColumnSpan="3"
                                        Fill="#FFC9CACA"
                                        Height="1"
                                        StrokeThickness="1"
                                        VerticalAlignment="Bottom"
                                        Width="Auto" />
                                    <dataPrimitives:DataGridRowsPresenter
                                        x:Name="RowsPresenter"
                                        Grid.ColumnSpan="2"
                                        Grid.Row="1" />
                                    <Rectangle
                                        x:Name="BottomRightCorner"
                                        Grid.Column="2"
                                        Fill="#FFE9EEF4"
                                        Grid.Row="2" />
                                    <Rectangle
                                        x:Name="BottomLeftCorner"
                                        Grid.ColumnSpan="2"
                                        Fill="#FFE9EEF4"
                                        Grid.Row="2" />
                                    <ScrollBar
                                        x:Name="VerticalScrollbar"
                                        Grid.Column="2"
                                        Margin="0,-1,-1,-1"
                                        Orientation="Vertical"
                                        Grid.Row="1"
                                        Width="18" />
                                    <Grid
                                        Grid.Column="1"
                                        Grid.Row="2">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition
                                                Width="Auto" />
                                            <ColumnDefinition />
                                        </Grid.ColumnDefinitions>
                                        <Rectangle
                                            x:Name="FrozenColumnScrollBarSpacer" />
                                        <ScrollBar
                                            x:Name="HorizontalScrollbar"
                                            Grid.Column="1"
                                            Height="18"
                                            Margin="-1,0,-1,-1"
                                            Orientation="Horizontal" />
                                    </Grid>
                                    <l:ValidationSummary
                                        x:Name="ValidationSummary"
                                        Grid.ColumnSpan="3"
                                        Filter="ObjectErrors"
                                        MaxHeight="90"
                                        Grid.Row="3" />
                                </Grid>
                            </Border>
                            <Border
                                x:Name="DisabledVisualElement"
                                Background="#8CFFFFFF"
                                CornerRadius="2"
                                HorizontalAlignment="Stretch"
                                Height="Auto"
                                IsHitTestVisible="False"
                                Opacity="0"
                                VerticalAlignment="Stretch"
                                Width="Auto" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style
            x:Key="CalendarItemStyle1"
            TargetType="System_Windows_Controls_Primitives:CalendarItem">
            <Setter
                Property="Template">
                <Setter.Value>
                    <ControlTemplate
                        TargetType="System_Windows_Controls_Primitives:CalendarItem">
                        <Grid>
                            <Grid.Resources>
                                <SolidColorBrush
                                    x:Key="DisabledBrush"
                                    Color="#8CFFFFFF" />
                            </Grid.Resources>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup
                                    x:Name="CommonStates">
                                    <VisualState
                                        x:Name="Normal" />
                                    <VisualState
                                        x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation
                                                Duration="0"
                                                To="0.5"
                                                Storyboard.TargetProperty="Opacity"
                                                Storyboard.TargetName="DisabledVisual" />
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="1"
                                Margin="0,2,0,2">
                                <Border
                                    BorderBrush="#FFFFFFFF"
                                    BorderThickness="2"
                                    CornerRadius="1">
                                    <Grid>
                                        <Grid.Resources>
                                            <ControlTemplate
                                                x:Key="HeaderButtonTemplate"
                                                TargetType="Button">
                                                <Grid
                                                    Cursor="Hand">
                                                    <VisualStateManager.VisualStateGroups>
                                                        <VisualStateGroup
                                                            x:Name="CommonStates">
                                                            <VisualState
                                                                x:Name="Normal" />
                                                            <VisualState
                                                                x:Name="MouseOver">
                                                                <Storyboard>
                                                                    <ColorAnimation
                                                                        Duration="0"
                                                                        To="#FF73A9D8"
                                                                        Storyboard.TargetProperty="(ContentControl.Foreground).(SolidColorBrush.Color)"
                                                                        Storyboard.TargetName="Content" />
                                                                </Storyboard>
                                                            </VisualState>
                                                            <VisualState
                                                                x:Name="Disabled">
                                                                <Storyboard>
                                                                    <DoubleAnimation
                                                                        Duration="0"
                                                                        To=".5"
                                                                        Storyboard.TargetProperty="Opacity"
                                                                        Storyboard.TargetName="Content" />
                                                                </Storyboard>
                                                            </VisualState>
                                                        </VisualStateGroup>
                                                    </VisualStateManager.VisualStateGroups>
                                                    <ContentControl
                                                        x:Name="Content"
                                                        ContentTemplate="{TemplateBinding ContentTemplate}"
                                                        Content="{TemplateBinding Content}"
                                                        Foreground="#FF333333"
                                                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                        IsTabStop="False"
                                                        Margin="1,5,1,9"
                                                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                                                </Grid>
                                            </ControlTemplate>
                                            <DataTemplate
                                                x:Name="DayTitleTemplate">
                                                <TextBlock
                                                    FontWeight="Bold"
                                                    FontSize="9.5"
                                                    HorizontalAlignment="Center"
                                                    Margin="0,4,0,4"
                                                    Text="{Binding}"
                                                    VerticalAlignment="Center" />
                                            </DataTemplate>
                                            <ControlTemplate
                                                x:Key="PreviousButtonTemplate"
                                                TargetType="Button">
                                                <Grid
                                                    Cursor="Hand">
                                                    <VisualStateManager.VisualStateGroups>
                                                        <VisualStateGroup
                                                            x:Name="CommonStates">
                                                            <VisualState
                                                                x:Name="Normal" />
                                                            <VisualState
                                                                x:Name="MouseOver">
                                                                <Storyboard>
                                                                    <ColorAnimation
                                                                        Duration="0"
                                                                        To="#FF73A9D8"
                                                                        Storyboard.TargetProperty="(Path.Fill).(SolidColorBrush.Color)"
                                                                        Storyboard.TargetName="IconPath" />
                                                                </Storyboard>
                                                            </VisualState>
                                                            <VisualState
                                                                x:Name="Disabled">
                                                                <Storyboard>
                                                                    <DoubleAnimation
                                                                        Duration="0"
                                                                        To=".5"
                                                                        Storyboard.TargetProperty="(Path.Fill).(SolidColorBrush.Opacity)"
                                                                        Storyboard.TargetName="IconPath" />
                                                                </Storyboard>
                                                            </VisualState>
                                                        </VisualStateGroup>
                                                    </VisualStateManager.VisualStateGroups>
                                                    <Rectangle
                                                        Fill="#11E5EBF1"
                                                        Opacity="1"
                                                        Stretch="Fill" />
                                                    <Grid>
                                                        <Path
                                                            x:Name="IconPath"
                                                            Data="M288.75,232.25 L288.75,240.625 L283,236.625 z"
                                                            Fill="#FF333333"
                                                            HorizontalAlignment="Left"
                                                            Height="10"
                                                            Margin="14,-6,0,0"
                                                            Stretch="Fill"
                                                            VerticalAlignment="Center"
                                                            Width="6" />
                                                    </Grid>
                                                </Grid>
                                            </ControlTemplate>
                                            <ControlTemplate
                                                x:Key="NextButtonTemplate"
                                                TargetType="Button">
                                                <Grid
                                                    Cursor="Hand">
                                                    <VisualStateManager.VisualStateGroups>
                                                        <VisualStateGroup
                                                            x:Name="CommonStates">
                                                            <VisualState
                                                                x:Name="Normal" />
                                                            <VisualState
                                                                x:Name="MouseOver">
                                                                <Storyboard>
                                                                    <ColorAnimation
                                                                        Duration="0"
                                                                        To="#FF73A9D8"
                                                                        Storyboard.TargetProperty="(Path.Fill).(SolidColorBrush.Color)"
                                                                        Storyboard.TargetName="IconPath" />
                                                                </Storyboard>
                                                            </VisualState>
                                                            <VisualState
                                                                x:Name="Disabled">
                                                                <Storyboard>
                                                                    <DoubleAnimation
                                                                        Duration="0"
                                                                        To=".5"
                                                                        Storyboard.TargetProperty="(Path.Fill).(SolidColorBrush.Opacity)"
                                                                        Storyboard.TargetName="IconPath" />
                                                                </Storyboard>
                                                            </VisualState>
                                                        </VisualStateGroup>
                                                    </VisualStateManager.VisualStateGroups>
                                                    <Rectangle
                                                        Fill="#11E5EBF1"
                                                        Opacity="1"
                                                        Stretch="Fill" />
                                                    <Grid>
                                                        <Path
                                                            x:Name="IconPath"
                                                            Data="M282.875,231.875 L282.875,240.375 L288.625,236 z"
                                                            Fill="#FF333333"
                                                            HorizontalAlignment="Right"
                                                            Height="10"
                                                            Margin="0,-6,14,0"
                                                            Stretch="Fill"
                                                            VerticalAlignment="Center"
                                                            Width="6" />
                                                    </Grid>
                                                </Grid>
                                            </ControlTemplate>
                                        </Grid.Resources>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition
                                                Width="Auto" />
                                            <ColumnDefinition
                                                Width="Auto" />
                                            <ColumnDefinition
                                                Width="Auto" />
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition
                                                Height="Auto" />
                                            <RowDefinition
                                                Height="*" />
                                        </Grid.RowDefinitions>
                                        <Button
                                            x:Name="PreviousButton"
                                            HorizontalAlignment="Left"
                                            Height="20"
                                            Template="{StaticResource PreviousButtonTemplate}"
                                            Visibility="Collapsed"
                                            Width="28" />
                                        <Button
                                            x:Name="HeaderButton"
                                            Grid.Column="1"
                                            FontWeight="Bold"
                                            FontSize="10.5"
                                            HorizontalAlignment="Center"
                                            Template="{StaticResource HeaderButtonTemplate}"
                                            VerticalAlignment="Center" />
                                        <Button
                                            x:Name="NextButton"
                                            Grid.Column="2"
                                            HorizontalAlignment="Right"
                                            Height="20"
                                            Template="{StaticResource NextButtonTemplate}"
                                            Visibility="Collapsed"
                                            Width="28" />
                                        <Grid
                                            x:Name="MonthView"
                                            Grid.ColumnSpan="3"
                                            Margin="6,-1,6,6"
                                            Grid.Row="1"
                                            Visibility="Collapsed">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition
                                                    Width="Auto" />
                                                <ColumnDefinition
                                                    Width="Auto" />
                                                <ColumnDefinition
                                                    Width="Auto" />
                                                <ColumnDefinition
                                                    Width="Auto" />
                                                <ColumnDefinition
                                                    Width="Auto" />
                                                <ColumnDefinition
                                                    Width="Auto" />
                                                <ColumnDefinition
                                                    Width="Auto" />
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition
                                                    Height="Auto" />
                                                <RowDefinition
                                                    Height="Auto" />
                                                <RowDefinition
                                                    Height="Auto" />
                                                <RowDefinition
                                                    Height="Auto" />
                                                <RowDefinition
                                                    Height="Auto" />
                                                <RowDefinition
                                                    Height="Auto" />
                                                <RowDefinition
                                                    Height="Auto" />
                                            </Grid.RowDefinitions>
                                        </Grid>
                                        <Grid
                                            x:Name="YearView"
                                            Grid.ColumnSpan="3"
                                            Margin="6,-3,7,6"
                                            Grid.Row="1"
                                            Visibility="Collapsed">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition
                                                    Width="Auto" />
                                                <ColumnDefinition
                                                    Width="Auto" />
                                                <ColumnDefinition
                                                    Width="Auto" />
                                                <ColumnDefinition
                                                    Width="Auto" />
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition
                                                    Height="Auto" />
                                                <RowDefinition
                                                    Height="Auto" />
                                                <RowDefinition
                                                    Height="Auto" />
                                            </Grid.RowDefinitions>
                                        </Grid>
                                    </Grid>
                                </Border>
                            </Border>
                            <Rectangle
                                x:Name="DisabledVisual"
                                Fill="{StaticResource DisabledBrush}"
                                Margin="0,2,0,2"
                                Opacity="0"
                                RadiusY="2"
                                RadiusX="2"
                                Stretch="Fill"
                                Stroke="{StaticResource DisabledBrush}"
                                StrokeThickness="1"
                                Visibility="Collapsed" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style
            x:Key="CalendarStyle1"
            TargetType="controls:Calendar">
            <Setter
                Property="IsTabStop"
                Value="False" />
            <Setter
                Property="Background">
                <Setter.Value>
                    <LinearGradientBrush
                        EndPoint="0.5,1"
                        StartPoint="0.5,0">
                        <GradientStop
                            Color="#FFD3DEE8"
                            Offset="0" />
                        <GradientStop
                            Color="#FFD3DEE8"
                            Offset="0.16" />
                        <GradientStop
                            Color="#FFFCFCFD"
                            Offset="0.16" />
                        <GradientStop
                            Color="#FFFFFFFF"
                            Offset="1" />
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter
                Property="BorderThickness"
                Value="1" />
            <Setter
                Property="BorderBrush">
                <Setter.Value>
                    <LinearGradientBrush
                        EndPoint="0.5,1"
                        StartPoint="0.5,0">
                        <GradientStop
                            Color="#FFA3AEB9"
                            Offset="0" />
                        <GradientStop
                            Color="#FF8399A9"
                            Offset="0.375" />
                        <GradientStop
                            Color="#FF718597"
                            Offset="0.375" />
                        <GradientStop
                            Color="#FF617584"
                            Offset="1" />
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter
                Property="Template">
                <Setter.Value>
                    <ControlTemplate
                        TargetType="controls:Calendar">
                        <StackPanel
                            x:Name="Root"
                            HorizontalAlignment="Center">
                            <System_Windows_Controls_Primitives:CalendarItem
                                x:Name="CalendarItem"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}"
                                Style="{StaticResource CalendarItemStyle1}" />
                        </StackPanel>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <Grid
        x:Name="LayoutRoot"
        Background="#FF7297C5">
        <!--  visual state manager-->
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup
                x:Name="DragStates">
                <VisualStateGroup.Transitions>
                    <VisualTransition
                        GeneratedDuration="0:0:0.3">
                        <VisualTransition.GeneratedEasingFunction>
                            <CircleEase
                                EasingMode="EaseIn" />
                        </VisualTransition.GeneratedEasingFunction>
                    </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState
                    x:Name="Normal" />
                <VisualState
                    x:Name="DragOver">
                    <Storyboard>
                        <ColorAnimationUsingKeyFrames
                            Storyboard.TargetProperty="(Control.Background).(SolidColorBrush.Color)"
                            Storyboard.TargetName="rtb">
                            <EasingColorKeyFrame
                                KeyTime="0"
                                Value="#FFFFF7D1" />
                        </ColorAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <Image
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            Source="Images/logo.png"
            Stretch="None"
            Margin="4,9,0,0"
            Width="392" />
        <Border
            MaxWidth="900"
            Margin="0,50,0,10"
            Grid.RowSpan="1"
            BorderThickness="1"
            BorderBrush="#FF646464"
            FlowDirection="{Binding IsRTL, Converter={StaticResource BoolToFlowDirectionConverter}}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition
                        Height="93" />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid
                    Grid.Row="1">
                    <Rectangle
                        Fill="White"
                        Margin="0,1,1,0">
                        <Rectangle.Effect>
                            <DropShadowEffect
                                ShadowDepth="1"
                                Direction="371"
                                BlurRadius="7"
                                Opacity="0.345" />
                        </Rectangle.Effect>
                    </Rectangle>
                    <!-- RichTextBoxControl -->

                    <RichTextBox
                        x:Name="rtb"
                        SelectionChanged="rtb_SelectionChanged"
                        VerticalScrollBarVisibility="Auto"
                        KeyUp="rtb_KeyUp"
                        BorderBrush="{x:Null}"
                        Margin="8,10,10,8"
                        FontSize="20"
                        TextWrapping="Wrap"
                        MouseRightButtonDown="rtb_MouseRightButtonDown"
                        MouseRightButtonUp="rtb_MouseRightButtonUp"
                        MouseMove="rtb_MouseMove"
                        DragEnter="rtb_DragEnter"
                        DragLeave="rtb_DragLeave"
                        Drop="rtb_Drop"
                        AllowDrop="True" />

                    <Canvas
                        IsHitTestVisible="False"
                        Margin="8,10,10,8"
                        x:Name="highlightCanvas">
                        <!-- CaretHand Image -->
                        <Image
                            x:Name="caretHand"
                            Source="./Images/hand.png" />
                    </Canvas>

                    <TextBox
                        IsTabStop="False"
                        FontSize="20"
                        FontFamily="Lucida Console"
                        TextWrapping="Wrap"
                        VerticalScrollBarVisibility="Auto"
                        x:Name="xamlTb"
                        Visibility="Collapsed" />
                </Grid>
                <Rectangle
                    Height="94"
                    Grid.RowSpan="2"
                    VerticalAlignment="Top"
                    Stroke="#FF8B9097"
                    x:Name="mainPanel"
                    MouseRightButtonDown="mainPanel_MouseRightButtonDown"
                    MouseRightButtonUp="mainPanel_MouseRightButtonUp"
                    Fill="#FFDDEFFA" />

                <!-- Toolbar-->
                <Grid
                    Margin="3,3,3,1">
                    <Grid.RowDefinitions>
                        <RowDefinition
                            Height="27" />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition
                            Width="102" />
                        <ColumnDefinition
                            Width="176" />
                        <ColumnDefinition
                            Width="184" />
                        <ColumnDefinition
                            Width="73" />
                        <ColumnDefinition
                            Width="106" />
                        <ColumnDefinition
                            Width="80" />
                        <ColumnDefinition
                            Width="80" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>

                    <Rectangle
                        Margin="0,-26,0,2"
                        Grid.RowSpan="1"
                        Fill="{StaticResource MenuDividerBrush}"
                        Grid.Row="1"
                        RadiusX="2"
                        RadiusY="2"
                        Stroke="#FFA5BED4" />
                    <Rectangle
                        Margin="2,-26,0,2"
                        Fill="{StaticResource MenuDividerBrush}"
                        Grid.Column="1"
                        Grid.Row="1"
                        RadiusX="2"
                        RadiusY="2"
                        Stroke="#FFA5BED4" />

                    <Rectangle
                        Margin="2,-26,0,2"
                        Fill="{StaticResource MenuDividerBrush}"
                        Grid.Column="2"
                        Grid.Row="1"
                        RadiusX="2"
                        RadiusY="2"
                        Stroke="#FFA5BED4" />
                    <Rectangle
                        Margin="2,-26,0,2"
                        Fill="{StaticResource MenuDividerBrush}"
                        Grid.Column="3"
                        Grid.Row="1"
                        RadiusX="2"
                        RadiusY="2"
                        Stroke="#FFA5BED4" />
                    <Rectangle
                        Margin="2,-26,0,2"
                        Fill="{StaticResource MenuDividerBrush}"
                        Grid.Column="4"
                        Grid.Row="1"
                        RadiusX="2"
                        RadiusY="2"
                        Stroke="#FFA5BED4" />
                    <Rectangle
                        Margin="2,-26,0,2"
                        Fill="{StaticResource MenuDividerBrush}"
                        Grid.Column="5"
                        Grid.Row="1"
                        RadiusX="2"
                        RadiusY="2"
                        Stroke="#FFA5BED4" />
                    <Rectangle
                        Margin="2,-26,0,2"
                        Fill="{StaticResource MenuDividerBrush}"
                        Grid.Column="6"
                        Grid.Row="1"
                        RadiusX="2"
                        RadiusY="2"
                        Stroke="#FFA5BED4" />
                    <Rectangle
                        Margin="2,-26,0,2"
                        Fill="{StaticResource MenuDividerBrush}"
                        Grid.Column="7"
                        Grid.Row="1"
                        RadiusX="2"
                        RadiusY="2"
                        Stroke="#FFA5BED4" />

                    <!--Font Buttons-->
                    <!--Fonts Face Combo-->
                    <ComboBox
                        x:Name="cmbFonts"
                        FontFamily="{Binding SelectedItem.FontFamily, RelativeSource={RelativeSource Self}}"
                        FontSize="{Binding SelectedItem.FontSize, RelativeSource={RelativeSource Self}}"
                        Grid.Column="1"
                        Margin="6,0,55,0"
                        Height="22"
                        VerticalAlignment="Bottom"
                        SelectionChanged="cmbFonts_SelectionChanged">
                        <ComboBoxItem
                            Content="Arial"
                            Tag="Arial"
                            FontFamily="Arial"
                            FontSize="12" />
                        <ComboBoxItem
                            Content="Arial Black"
                            Tag="Arial Black"
                            FontFamily="Arial Black"
                            FontSize="12" />
                        <ComboBoxItem
                            Content="Calibri"
                            Tag="Calibri"
                            FontFamily="Calibri"
                            IsSelected="True"
                            FontSize="14" />
                        <ComboBoxItem
                            Content="Comic Sans MS"
                            Tag="Comic Sans MS"
                            FontFamily="Comic Sans MS"
                            FontSize="12" />
                        <ComboBoxItem
                            Content="Courier New"
                            Tag="Courier New"
                            FontFamily="Courier New"
                            FontSize="12" />
                        <ComboBoxItem
                            Content="Georgia"
                            Tag="Georgia"
                            FontFamily="Georgia"
                            FontSize="12" />
                        <ComboBoxItem
                            Content="Lucida Sans Unicode"
                            Tag="Lucida Sans Unicode"
                            FontFamily="Lucida Sans Unicode"
                            FontSize="12" />
                        <ComboBoxItem
                            Content="Portable User Interface"
                            Tag="{x:Null}"
                            FontFamily="Portable User Interface"
                            FontSize="12" />
                        <ComboBoxItem
                            Content="Times New Roman"
                            Tag="Times New Roman"
                            FontFamily="Times New Roman"
                            FontSize="12" />
                        <ComboBoxItem
                            Content="Trebuchet MS"
                            Tag="Trebuchet MS"
                            FontFamily="Trebuchet MS"
                            FontSize="12" />
                        <ComboBoxItem
                            Content="Verdana"
                            Tag="Verdana"
                            FontFamily="Verdana"
                            FontSize="12" />
                        <ComboBoxItem
                            Content="Webdings"
                            Tag="Webdings"
                            FontSize="12" />
                    </ComboBox>

                    <ComboBox
                        x:Name="cmbFontSizes"
                        Width="44"
                        FontSize="14"
                        HorizontalAlignment="Right"
                        Margin="0,0,6,0"
                        Grid.Column="1"
                        Height="22"
                        VerticalAlignment="Bottom"
                        SelectionChanged="cmbFontSizes_SelectionChanged">
                        <ComboBoxItem
                            Content="8"
                            Tag="8" />
                        <ComboBoxItem
                            Content="9"
                            Tag="9" />
                        <ComboBoxItem
                            Content="10"
                            Tag="10" />
                        <ComboBoxItem
                            Content="11"
                            Tag="11" />
                        <ComboBoxItem
                            Content="12"
                            Tag="12" />
                        <ComboBoxItem
                            Content="14"
                            Tag="14" />
                        <ComboBoxItem
                            Content="16"
                            Tag="16"
                            IsSelected="True" />
                        <ComboBoxItem
                            Content="18"
                            Tag="18" />
                        <ComboBoxItem
                            Content="20"
                            Tag="20" />
                        <ComboBoxItem
                            Content="22"
                            Tag="22" />
                        <ComboBoxItem
                            Content="24"
                            Tag="24" />
                        <ComboBoxItem
                            Content="26"
                            Tag="26" />
                        <ComboBoxItem
                            Content="28"
                            Tag="28" />
                        <ComboBoxItem
                            Content="36"
                            Tag="36" />
                        <ComboBoxItem
                            Content="48"
                            Tag="48" />
                        <ComboBoxItem
                            Content="72"
                            Tag="72" />
                    </ComboBox>



                    <StackPanel
                        Grid.Column="1"
                        Height="22"
                        Margin="6,5,0,0"
                        Orientation="Horizontal"
                        Grid.Row="1"
                        VerticalAlignment="Top">

                        <!--Font Formatting Buttons-->
                        <Button
                            x:Name="btnBold"
                            Margin="0,0,1,0"
                            Click="btnBold_Click">
                            <ToolTipService.ToolTip>
                                <ToolTip
                                    FontSize="16"
                                    Content="{Binding tooltip_Bold, Source={StaticResource localizedStrings}}" />
                            </ToolTipService.ToolTip>
                            <Image
                                Source="Images/Bold.png"
                                d:IsLocked="True" />
                        </Button>

                        <Button
                            x:Name="btnItalic"
                            Margin="0,0,1,0"
                            Click="btnItalic_Click">
                            <ToolTipService.ToolTip>
                                <ToolTip
                                    FontSize="16"
                                    Content="{Binding tooltip_Italic, Source={StaticResource localizedStrings}}" />
                            </ToolTipService.ToolTip>
                            <Image
                                Source="Images/Italic.png" />
                        </Button>

                        <Button
                            x:Name="btnUnderline"
                            Margin="0,0,13,0"
                            Click="btnUnderline_Click">
                            <ToolTipService.ToolTip>
                                <ToolTip
                                    FontSize="16"
                                    Content="Underline" />
                            </ToolTipService.ToolTip>
                            <Image
                                Source="Images/Underline.png" />
                        </Button>

                        <ComboBox
                            x:Name="cmbFontColors"
                            SelectedIndex="0"
                            Margin="39,0,0,0"
                            HorizontalAlignment="Right"
                            SelectionChanged="cmbFontColors_SelectionChanged">
                            <ComboBoxItem
                                Tag="FFFF0000">
                                <Rectangle
                                    Width="22"
                                    Height="14"
                                    Fill="Red"
                                    Margin="2,0,0,0" />
                            </ComboBoxItem>
                            <ComboBoxItem
                                Tag="FF008000">
                                <Rectangle
                                    Width="22"
                                    Height="14"
                                    Fill="Green"
                                    Margin="2,0,0,0" />
                            </ComboBoxItem>
                            <ComboBoxItem
                                Tag="FF0000FF">
                                <Rectangle
                                    Width="22"
                                    Height="14"
                                    Fill="Blue"
                                    Margin="2,0,0,0" />
                            </ComboBoxItem>
                            <ComboBoxItem
                                Tag="FFFFFF00">
                                <Rectangle
                                    Width="22"
                                    Height="14"
                                    Fill="Yellow"
                                    Margin="2,0,0,0" />
                            </ComboBoxItem>
                            <ComboBoxItem
                                Tag="FF000000"
                                IsSelected="True">
                                <Rectangle
                                    Width="22"
                                    Height="14"
                                    Fill="Black"
                                    Margin="2,0,0,0" />
                            </ComboBoxItem>
                        </ComboBox>
                    </StackPanel>


                    <!-- Clipboard Buttons-->
                    <Button
                        x:Name="btnPaste"
                        Margin="17,-22,33,24"
                        Grid.Row="1"
                        HorizontalAlignment="Left"
                        Click="btnPaste_Click">
                        <ToolTipService.ToolTip>
                            <ToolTip
                                FontSize="16"
                                Content="Paste" />
                        </ToolTipService.ToolTip>
                        <Image
                            Source="Images/Paste_big.png"
                            Height="32"
                            Width="29" />
                    </Button>
                    <Button
                        x:Name="btnCut"
                        Margin="0,0,17,0"
                        HorizontalAlignment="Right"
                        Width="22"
                        VerticalAlignment="Bottom"
                        Click="btnCut_Click">
                        <ToolTipService.ToolTip>
                            <ToolTip
                                FontSize="16"
                                Content="Cut" />
                        </ToolTipService.ToolTip>
                        <Image
                            Source="Images/Cut.png"
                            d:IsLocked="True" />
                    </Button>
                    <Button
                        x:Name="btnCopy"
                        Margin="0,5,17,0"
                        VerticalAlignment="Top"
                        Grid.Row="1"
                        HorizontalAlignment="Right"
                        Width="22"
                        Click="btnCopy_Click">
                        <ToolTipService.ToolTip>
                            <ToolTip
                                FontSize="16"
                                Content="Copy" />
                        </ToolTipService.ToolTip>
                        <Image
                            Source="Images/Copy.png"
                            d:IsLocked="True" />
                    </Button>


                    <!-- Insert Buttons-->
                    <Button
                        x:Name="btnImage"
                        HorizontalAlignment="Left"
                        Grid.Column="2"
                        Margin="13,-22,0,24"
                        Grid.RowSpan="1"
                        Grid.Row="1"
                        Click="btnImage_Click">
                        <ToolTipService.ToolTip>
                            <ToolTip
                                FontSize="16"
                                Content="{Binding tooltip_Image, Source={StaticResource localizedStrings}}" />
                        </ToolTipService.ToolTip>
                        <Image
                            Source="Images/Image.png"
                            Height="32"
                            Width="30" />
                    </Button>

                    <Button
                        x:Name="btnHyperlink"
                        Grid.Column="2"
                        Margin="55,-22,0,24"
                        Grid.RowSpan="1"
                        Grid.Row="1"
                        HorizontalAlignment="Left"
                        Click="btnHyperlink_Click">
                        <ToolTipService.ToolTip>
                            <ToolTip
                                FontSize="16"
                                Content="{Binding tooltip_Hyperlink, Source={StaticResource localizedStrings}}" />
                        </ToolTipService.ToolTip>
                        <Image
                            Source="Images/Hyperlink_big.png"
                            Width="30"
                            Height="32" />
                    </Button>

                    <Button
                        x:Name="btnDatagrid"
                        Grid.Column="2"
                        Grid.RowSpan="1"
                        Margin="97,-22,0,24"
                        HorizontalAlignment="Left"
                        Grid.Row="1"
                        Click="btnDatagrid_Click">
                        <ToolTipService.ToolTip>
                            <ToolTip
                                FontSize="16"
                                Content="Insert Datagrid" />
                        </ToolTipService.ToolTip>
                        <Image
                            Source="Images/datagrid.png"
                            Width="29"
                            Height="32" />
                    </Button>

                    <Button
                        x:Name="btnCalendar"
                        Grid.Column="2"
                        Grid.RowSpan="1"
                        Margin="138,-22,0,24"
                        HorizontalAlignment="Left"
                        Grid.Row="1"
                        Click="btnCalendar_Click">
                        <ToolTipService.ToolTip>
                            <ToolTip
                                FontSize="16"
                                Content="Insert Calendar" />
                        </ToolTipService.ToolTip>
                        <Image
                            Source="Images/calendar.png"
                            Width="29"
                            Height="32" />
                    </Button>

                    <!-- Print Button-->
                    <Button
                        x:Name="btnPrint"
                        Grid.Column="3"
                        Margin="20,-22,0,24"
                        HorizontalAlignment="Left"
                        Grid.Row="1"
                        Click="btnPrint_Click">
                        <ToolTipService.ToolTip>
                            <ToolTip
                                FontSize="16"
                                Content="{Binding tooltip_Print, Source={StaticResource localizedStrings}}" />
                        </ToolTipService.ToolTip>
                        <Image
                            Source="Images/Print_big.png"
                            Width="30" />
                    </Button>


                    <!-- Display, Highlight, Xaml Buttons-->

                    <!-- Highlight Button-->
                    <ToggleButton
                        x:Name="btnHighlight"
                        Checked="btnHighlight_Checked"
                        Unchecked="btnHighlight_Checked"
                        Margin="17,-22,15,24"
                        Grid.Column="5"
                        Grid.Row="1"
                        HorizontalAlignment="Left">
                        <ToolTipService.ToolTip>
                            <ToolTip
                                FontSize="16"
                                Content="Show Highlight" />
                        </ToolTipService.ToolTip>
                        <Image
                            Source="Images/Annotation_New.png" />
                    </ToggleButton>

                    <!-- Xaml Buttons-->
                    <ToggleButton
                        x:Name="btnMarkUp"
                        Checked="btnMarkUp_Checked"
                        Unchecked="btnMarkUp_Checked"
                        Margin="10,-22,10,24"
                        Grid.Column="6"
                        Grid.Row="1"
                        HorizontalAlignment="Left">
                        <ToolTipService.ToolTip>
                            <ToolTip
                                FontSize="16"
                                Content="Show XAML" />
                        </ToolTipService.ToolTip>
                        <TextBlock
                            FontSize="25"
                            Text="&lt;&lt;>>" />
                    </ToggleButton>

                    <ToggleButton
                        x:Name="btnRTL"
                        Checked="btnRTL_Checked"
                        Unchecked="btnRTL_Checked"
                        Grid.Column="4"
                        Margin="15,-22,0,24"
                        HorizontalAlignment="Center"
                        Grid.Row="1">
                        <ToolTipService.ToolTip>
                            <ToolTip
                                FontSize="16"
                                Content="Text Direction" />
                        </ToolTipService.ToolTip>
                        <Image
                            Source="Images/ltr.png"
                            Width="30" />
                    </ToggleButton>



                    <TextBlock
                        Style="{StaticResource MenuLabel}"
                        Text="Clipboard"
                        Grid.Row="1" />
                    <TextBlock
                        Style="{StaticResource MenuLabel}"
                        Text="Font"
                        Grid.Column="1"
                        Grid.Row="1" />
                    <TextBlock
                        Style="{StaticResource MenuLabel}"
                        Text="Insert"
                        Grid.Column="2"
                        Grid.Row="1" />
                    <TextBlock
                        Style="{StaticResource MenuLabel}"
                        Text="Print"
                        Grid.Column="3"
                        Grid.Row="1" />
                    <TextBlock
                        Style="{StaticResource MenuLabel}"
                        Text="Display"
                        Grid.Column="4"
                        Grid.Row="1" />
                    <TextBlock
                        Style="{StaticResource MenuLabel}"
                        Text="Highlight"
                        Grid.Column="5"
                        Grid.Row="1" />
                    <TextBlock
                        Style="{StaticResource MenuLabel}"
                        Text="XAML"
                        Grid.Column="6"
                        Grid.Row="1" />
                </Grid>

                <!-- Open, Save, New Buttons-->
                <StackPanel
                    Grid.RowSpan="1"
                    Grid.Column="4"
                    Margin="8"
                    VerticalAlignment="Top"
                    HorizontalAlignment="Right"
                    Orientation="Horizontal"
                    Grid.Row="0">

                    <!--New Button-->
                    <Button
                        x:Name="btnNew"
                        HorizontalAlignment="Left"
                        Height="22"
                        Margin="0,0,0,0"
                        VerticalAlignment="Top"
                        Width="22"
                        Click="btnNew_Click">
                        <ToolTipService.ToolTip>
                            <ToolTip
                                FontSize="16"
                                Content="{Binding tooltip_New, Source={StaticResource localizedStrings}}" />
                        </ToolTipService.ToolTip>
                        <Image
                            Source="Images/New.png" />
                    </Button>
                    <!--Open Existing Button -->
                    <Button
                        x:Name="btnOpen"
                        HorizontalAlignment="Left"
                        Height="22"
                        Margin="0,0,0,4"
                        VerticalAlignment="Top"
                        Width="22"
                        Click="btnOpen_Click">
                        <ToolTipService.ToolTip>
                            <ToolTip
                                FontSize="16"
                                Content="{Binding tooltip_Open, Source={StaticResource localizedStrings}}" />
                        </ToolTipService.ToolTip>
                        <Image
                            Source="Images/Open.png" />
                    </Button>
                    <!--Save Existing Button -->
                    <Button
                        x:Name="btnSave"
                        HorizontalAlignment="Left"
                        Height="22"
                        VerticalAlignment="Top"
                        Width="22"
                        Click="btnSave_Click">
                        <ToolTipService.ToolTip>
                            <ToolTip
                                FontSize="16"
                                Content="{Binding tooltip_Save, Source={StaticResource localizedStrings}}" />
                        </ToolTipService.ToolTip>
                        <Image
                            Source="Images/Save.png" />
                    </Button>

                </StackPanel>


            </Grid>
        </Border>
    </Grid>
</UserControl>
